package main.scripts;
import java.awt.Graphics;
import java.util.Random;

import javax.swing.JOptionPane;

import main.client;
import main.bots.Bot;
import main.bots.Script;
import main.listeners.PaintListener;
import main.listeners.ServerMessageListener;


public class Thieving extends Script implements Runnable, Bot, ServerMessageListener {
	
	public static int xCoord = 0;
	public static int yCoord = 0;
	public static int objectId = 0;
	public boolean toStop = false;
	
	@Override
	public boolean endCondition() {
		return toStop;
	}
	@Override
	public String[] getAuthors() {
		return new String[] { "Coder Austin" };
	}
	@Override
	public double getVersion() {
	return 1.0;
	}
	@Override
	public int loop() {
		if(getMyClient() == null || getMyClient() == null) {
			return 100;
		}
		getMyClient().stream.clickObject252(objectId, yCoord, xCoord);
		return random(1000, 6000);
	}
	@Override
	public void onFinish() {
	debug("Thanks for using the theiving bot");
		
	}
	@Override
	public boolean onStart() {
		String s2 = JOptionPane.showInputDialog(this, (new StringBuilder()).append("Enter in X Coord and y coord and id seperated by a comma"), "", 3);
		String[] s3 = s2.split(",");
		xCoord = Integer.parseInt(s3[0].trim().replaceAll(" ", ""));
		yCoord = Integer.parseInt(s3[1].trim().replaceAll(" ", ""));
		objectId = Integer.parseInt(s3[2].trim().replaceAll(" ", ""));
		return getMyClient() != null;
	}
	@Override
	public String getCategory() {
		return "Thieving";
	}
	
	@Override
	public void serverMessageRecieved(String message) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public String getDescription() {
	return "blah";
	}
	@Override
	public String getScriptName() {
		// TODO Auto-generated method stub
		return "Theiving";
	}

}
